int warn_region0_address = 0; // FIXME later: tie to a boot parameter?
+// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
+static inline int vcpu_match_tr_entry(TR_ENTRY *trp, UINT64 ifa, UINT64 rid)
+{
+ return trp->p && trp->rid == rid
+ && ifa >= trp->vadr
+ && ifa <= (trp->vadr + (1L << trp->ps) - 1);
+}
+
IA64FAULT vcpu_translate(VCPU *vcpu, UINT64 address, BOOLEAN is_data, BOOLEAN in_tpa, UINT64 *pteval, UINT64 *itir, UINT64 *iha)
{
unsigned long region = address >> 61;
typedef cpu_user_regs_t REGS;
+/* Note: PSCB stands for Privilegied State Communication Block. */
#define VCPU(_v,_x) (_v->arch.privregs->_x)
#define PSCB(_v,_x) VCPU(_v,_x)
#define PSCBX(_v,_x) (_v->arch._x)
#define vcpu_quick_region_set(_tr_regions,_ifa) \
do {_tr_regions |= (1 << ((unsigned long)_ifa >> 61)); } while (0)
-// FIXME: also need to check && (!trp->key || vcpu_pkr_match(trp->key))
-#define vcpu_match_tr_entry(_trp,_ifa,_rid) \
- ((_trp->p && (_trp->rid==_rid) && (_ifa >= _trp->vadr) && \
- (_ifa < (_trp->vadr + (1L<< _trp->ps)) - 1)))
-
#endif